From: Vicente Bertolotti Date: Sat, 25 Apr 2026 01:26:28 +0000 (-0400) Subject: animation: Prevent spinner animation from resetting X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~10^2^2~24 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2b1269fee44186f5778007e66f63edafd45eb645;p=gnome-shell.git animation: Prevent spinner animation from resetting Currently, the search status spinner animation restarts on every single keystroke while a search is in progress. This occurs because redundant calls to `play()` replace the previous content and restart the animation from the beginning. This commit fixes this by ignoring redundant `play()` and `stop()` calls. Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8695 Part-of: --- diff --git a/js/ui/animation.js b/js/ui/animation.js index 882241cb1..a76bc3a9a 100644 --- a/js/ui/animation.js +++ b/js/ui/animation.js @@ -32,6 +32,8 @@ class Spinner extends St.Widget { } play() { + if (this._playing) + return; this.remove_all_transitions(); this.set_content(new St.SpinnerContent()); this.show(); @@ -49,6 +51,8 @@ class Spinner extends St.Widget { } stop() { + if (!this._playing) + return; this.remove_all_transitions(); if (this._animate) { @@ -70,4 +74,8 @@ class Spinner extends St.Widget { this.hide(); } } + + get _playing() { + return this.visible && this.content !== null; + } });